<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>三鑫-灯世界网销平台</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link href="__PUBLIC__/phone/css/zhuce_style.css" rel="stylesheet" media="screen, projection" />
	<link rel="stylesheet" href="__PUBLIC__/phone/css/styles.css" />
	<link rel="stylesheet" href="__PUBLIC__/phone/css/mui.min.css">
	<style type="text/css">
		.pt-list{padding: 10px;padding-bottom: 30px;}
		.item img{
			width: 100%;
			margin-bottom:10px;
		}
		.pt-h-link{
			background: #fff;display: inline-block;width: 100%;
		}
		.pt-list .pt-h-item1 {
			padding: 0;width: 50%;float: left;padding:4px;
		}
		.pt-list .pt-h-img1 {
			width: 100%;
			height: 150px;
			overflow: hidden;
			text-align: center;
			vertical-align: middle;
			background-color: white
		}

		.pt-list .pt-h-img1 img {
			width: 100%;
			max-height: 150px;
			vertical-align: middle
		}

		.pt-list .pt-h-info1 {
			margin-left: 10px
		}
		.pt-h-name{
			height: 42px;
			word-break:break-all;
			display:-webkit-box;
			-webkit-line-clamp:2;
			-webkit-box-orient:vertical;
			overflow:hidden;
		}
	</style>
</head>
<body>
<!--公共搜索栏-->
<include file="./phone/Home/View/Public/search.html"/>
<header style="background: #00a1f2;position: fixed;top: 0;width: 100%;">
	<div class="a-bar">
		<a href="javascript:history.back()" class="a-back">
			<i class="arr left" style="top: 0px;height: 10px;width: 10px;"></i>
		</a>
		<div class="a-name" style="color:white;">商品列表</div>
	</div>
</header>
<!--下拉刷新容器-->
<div id="pullrefresh" class="mui-content mui-scroll-wrapper" style="top:50px;bottom: 22px;">
	<div class="mui-scroll" style="background:#efeff4;">
		<!--数据列表-->
		<ul class="mui-table-view mui-table-view-chevron pt-list waterfall" style="background:#efeff4;padding: 0;">
			<volist name="list" id="li">
				<li class="pt-h-item1 c-fix item" style="font-size: 14px;">
					<a href="{:U('goods_details')}?goods_id={$li.good_id}" class="pt-h-link">
						<div class="pt-h-img1">
							<img src="__ROOT__{$li.picture}">
						</div>
						<div class="pt-h-info1">
							<div class="pt-h-name">{$li.good_name}</div>
							<if condition="session(vip) neq 1">
								<div class="pt-h-other">
									<div class=" price">
										￥{$li.price}
									</div>
								</div>
								<else/>
								<div class="pt-h-other">
									<div class=" price" >
										<span style="font-size: 16px;">￥{$li.vip_price}</span>
										<span style="text-decoration: line-through;color: #ccc;">￥{$li.price}</span>

									</div>
								</div>
								<!--<div class="pt-h-other">
									<div class=" price">
										￥{$li.vip_price}
									</div>
								</div>-->
							</if>
						</div>
					</a>
				</li>
			</volist>
		</ul>
	</div>
</div>
<input type="hidden" id="pages" value="2">
<input type="hidden" id="cate_id" value="{$cate_id}">
<div class="full-screen">
	<!--公共底部-->
	<include file="./phone/Home/View/Public/foot.html"/>

</div>

<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/phone/js/mui.min.js"></script>
<script>
	mui.init({
		pullRefresh: {
			container: '#pullrefresh',
//			down: {
//				callback: pulldownRefresh
//			},
			up: {
				contentrefresh: '正在加载...',
				callback: pullupRefresh
			}
		}
	});
	/**
	 * 下拉刷新具体业务实现
	 */
//	function pulldownRefresh() {
//		setTimeout(function() {
//
//			mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
//		}, 1500);
//	}
	var count = false;
	var pages = $('#pages').val();
	var cate_id = $('#cate_id').val();
	/**
	 * 上拉加载具体业务实现
	 */
	function pullupRefresh() {
		setTimeout(function() {
			$.ajax({
				url:"{:U('goodsUpdata')}",
				data:{'page':pages,'cate_id':cate_id},
				type:'post',
				success:function (e) {
					if(e == -1){
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //参数为true代表没有更多数据了。
					}else{
						var da = JSON.parse(e);
						var repaly = '';
						for (var i=0;i<da.length;i++){
							repaly += '<li class="pt-h-item1 c-fix item" style="font-size: 14px;">'+
									'<a href="{:U(goods_details)}?goods_id='+da[i].good_id+'" class="pt-h-link">'+
									'<div class="pt-h-img1">'+
									'<img src="__ROOT__'+da[i].picture+'">'+
									'</div>'+
									'<div class="pt-h-info1">'+
									'<div class="pt-h-name">'+da[i].good_name+'</div>'+
									'<if condition="session(vip) neq 1">'+
									'<div class="pt-h-other">'+
									'<div class=" price">'+
									'￥{$li.price}'+
									'</div>'+
									'</div>'+
									'<else/>'+
									'<div class="pt-h-other">'+
									'<div class=" price" style="color: #ccc;text-decoration: line-through;">'+
									'￥{$li.price}'+
									'</div>'+
									'</div>'+
									'<div class="pt-h-other">'+
									'<div class=" price">'+
									'￥{$li.vip_price}'+
									'</div>'+
									'</div>'+
									'</if>'+
									'</div>'+
									'</a>'+
									'</li>';
						}
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); //参数为true代表没有更多数据了。
						$('.pt-list').append(repaly);
						pages++;
						$('#page').val(pages);
					}

				}
			});
		}, 50);
	}

	mui('body').on('tap','a',function(){
		window.top.location.href=this.href;
	});
//	//电工抢单按钮
//	mui('body').on('tap','#dian',function(){
//		alert('点错啦')
//	})
</script>
</body>

</html>